#include <stdio.h>

int main()
{
	char *str = "abcdefghijklmnopqrstuvwxyz";

	printf("o={%.*s}\n", 10, str);	/* o={abcdefghij} */
	printf("o={%.10s}\n", str);		/* o={abcdefghij} */
}

#if 0

%.*s	*号被常量代替，用于控制字符宽度；
%.10s	同样是控制字符宽度；

/* 反汇编 */
0000000000401136 <main>:
  401136:	f3 0f 1e fa          	endbr64 
  40113a:	55                   	push   %rbp
  40113b:	48 89 e5             	mov    %rsp,%rbp
  40113e:	48 83 ec 10          	sub    $0x10,%rsp
  401142:	48 c7 45 f8 04 20 40 	movq   $0x402004,-0x8(%rbp)	// (rbp-0x8)="abcdefghijklmnopqrstuvwxyz"
  401149:	00 
  40114a:	48 8b 45 f8          	mov    -0x8(%rbp),%rax		// rax="abcdefghijklmnopqrstuvwxyz"
  40114e:	48 89 c2             	mov    %rax,%rdx			// rdx="abcdefghijklmnopqrstuvwxyz"
  401151:	be 0a 00 00 00       	mov    $0xa,%esi			// esi=10
  401156:	bf 1f 20 40 00       	mov    $0x40201f,%edi		// edi="o={%.*s}\n"
  40115b:	b8 00 00 00 00       	mov    $0x0,%eax
  401160:	e8 db fe ff ff       	callq  401040 <printf@plt>	// printf(edi, esi, rdx)
  401165:	48 8b 45 f8          	mov    -0x8(%rbp),%rax		// rax="abcdefghijklmnopqrstuvwxyz"
  401169:	48 89 c6             	mov    %rax,%rsi			// rsi="abcdefghijklmnopqrstuvwxyz"
  40116c:	bf 29 20 40 00       	mov    $0x402029,%edi		// edi="o={%.10s}\n"
  401171:	b8 00 00 00 00       	mov    $0x0,%eax
  401176:	e8 c5 fe ff ff       	callq  401040 <printf@plt>	// printf(edi, rsi)
  40117b:	b8 00 00 00 00       	mov    $0x0,%eax
  401180:	c9                   	leaveq 
  401181:	c3                   	retq   

#endif
